package com.liu.queue.message;


import java.io.Serializable;

/**
 * @param
 * @BelongsProject: QueueDemo2
 * @BelongsPackage: com.liu.queue.message
 * @author: L
 * @Date: 2023/10/21 18:40
 * @return
 */

public class PullMessage implements Serializable {
    protected MessageTypeEnum messageType;
    protected byte[] topic;
    protected Integer num;

    public MessageTypeEnum getMessageType() {
        return messageType;
    }

    public void setMessageType(MessageTypeEnum messageType) {
        this.messageType = messageType;
    }

    public byte[] getTopic() {
        return topic;
    }

    public void setTopic(byte[] topic) {
        this.topic = topic;
    }

    public Integer getNum() {
        return num;
    }

    public void setNum(Integer num) {
        this.num = num;
    }

    /**
     * FastJSON底层使用构造器创建对应类
     * @param messageType
     * @param topic
     * @param num
     */
    public PullMessage(byte messageType, byte[] topic, Integer num) {
        this.messageType = MessageTypeEnum.get(messageType);
        this.topic = topic;
        this.num = num;
    }
}
